Optimal. Leaf size=372 \[ \frac {2 \left (45 a^3 A b+435 a A b^3-10 a^4 B+279 a^2 b^2 B+147 b^4 B\right ) \sqrt {a+b \cos (c+d x)} E\left (\frac {1}{2} (c+d x)|\frac {2 b}{a+b}\right )}{315 b^2 d \sqrt {\frac {a+b \cos (c+d x)}{a+b}}}-\frac {2 \left (a^2-b^2\right ) \left (45 a^2 A b+75 A b^3-10 a^3 B+114 a b^2 B\right ) \sqrt {\frac {a+b \cos (c+d x)}{a+b}} F\left (\frac {1}{2} (c+d x)|\frac {2 b}{a+b}\right )}{315 b^2 d \sqrt {a+b \cos (c+d x)}}+\frac {2 \left (45 a^2 A b+75 A b^3-10 a^3 B+114 a b^2 B\right ) \sqrt {a+b \cos (c+d x)} \sin (c+d x)}{315 b d}+\frac {2 \left (45 a A b-10 a^2 B+49 b^2 B\right ) (a+b \cos (c+d x))^{3/2} \sin (c+d x)}{315 b d}+\frac {2 (9 A b-2 a B) (a+b \cos (c+d x))^{5/2} \sin (c+d x)}{63 b d}+\frac {2 B (a+b \cos (c+d x))^{7/2} \sin (c+d x)}{9 b d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.46, antiderivative size = 372, normalized size of antiderivative = 1.00, number of steps
used = 10, number of rules used = 8, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.258, Rules used = {3047, 3102,
2832, 2831, 2742, 2740, 2734, 2732} \begin {gather*} \frac {2 \left (-10 a^2 B+45 a A b+49 b^2 B\right ) \sin (c+d x) (a+b \cos (c+d x))^{3/2}}{315 b d}+\frac {2 \left (-10 a^3 B+45 a^2 A b+114 a b^2 B+75 A b^3\right ) \sin (c+d x) \sqrt {a+b \cos (c+d x)}}{315 b d}-\frac {2 \left (a^2-b^2\right ) \left (-10 a^3 B+45 a^2 A b+114 a b^2 B+75 A b^3\right ) \sqrt {\frac {a+b \cos (c+d x)}{a+b}} F\left (\frac {1}{2} (c+d x)|\frac {2 b}{a+b}\right )}{315 b^2 d \sqrt {a+b \cos (c+d x)}}+\frac {2 \left (-10 a^4 B+45 a^3 A b+279 a^2 b^2 B+435 a A b^3+147 b^4 B\right ) \sqrt {a+b \cos (c+d x)} E\left (\frac {1}{2} (c+d x)|\frac {2 b}{a+b}\right )}{315 b^2 d \sqrt {\frac {a+b \cos (c+d x)}{a+b}}}+\frac {2 (9 A b-2 a B) \sin (c+d x) (a+b \cos (c+d x))^{5/2}}{63 b d}+\frac {2 B \sin (c+d x) (a+b \cos (c+d x))^{7/2}}{9 b d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2732
Rule 2734
Rule 2740
Rule 2742
Rule 2831
Rule 2832
Rule 3047
Rule 3102
Rubi steps
\begin {align*} \int \cos (c+d x) (a+b \cos (c+d x))^{5/2} (A+B \cos (c+d x)) \, dx &=\int (a+b \cos (c+d x))^{5/2} \left (A \cos (c+d x)+B \cos ^2(c+d x)\right ) \, dx\\ &=\frac {2 B (a+b \cos (c+d x))^{7/2} \sin (c+d x)}{9 b d}+\frac {2 \int (a+b \cos (c+d x))^{5/2} \left (\frac {7 b B}{2}+\frac {1}{2} (9 A b-2 a B) \cos (c+d x)\right ) \, dx}{9 b}\\ &=\frac {2 (9 A b-2 a B) (a+b \cos (c+d x))^{5/2} \sin (c+d x)}{63 b d}+\frac {2 B (a+b \cos (c+d x))^{7/2} \sin (c+d x)}{9 b d}+\frac {4 \int (a+b \cos (c+d x))^{3/2} \left (\frac {3}{4} b (15 A b+13 a B)+\frac {1}{4} \left (45 a A b-10 a^2 B+49 b^2 B\right ) \cos (c+d x)\right ) \, dx}{63 b}\\ &=\frac {2 \left (45 a A b-10 a^2 B+49 b^2 B\right ) (a+b \cos (c+d x))^{3/2} \sin (c+d x)}{315 b d}+\frac {2 (9 A b-2 a B) (a+b \cos (c+d x))^{5/2} \sin (c+d x)}{63 b d}+\frac {2 B (a+b \cos (c+d x))^{7/2} \sin (c+d x)}{9 b d}+\frac {8 \int \sqrt {a+b \cos (c+d x)} \left (\frac {3}{8} b \left (120 a A b+55 a^2 B+49 b^2 B\right )+\frac {3}{8} \left (45 a^2 A b+75 A b^3-10 a^3 B+114 a b^2 B\right ) \cos (c+d x)\right ) \, dx}{315 b}\\ &=\frac {2 \left (45 a^2 A b+75 A b^3-10 a^3 B+114 a b^2 B\right ) \sqrt {a+b \cos (c+d x)} \sin (c+d x)}{315 b d}+\frac {2 \left (45 a A b-10 a^2 B+49 b^2 B\right ) (a+b \cos (c+d x))^{3/2} \sin (c+d x)}{315 b d}+\frac {2 (9 A b-2 a B) (a+b \cos (c+d x))^{5/2} \sin (c+d x)}{63 b d}+\frac {2 B (a+b \cos (c+d x))^{7/2} \sin (c+d x)}{9 b d}+\frac {16 \int \frac {\frac {3}{16} b \left (405 a^2 A b+75 A b^3+155 a^3 B+261 a b^2 B\right )+\frac {3}{16} \left (45 a^3 A b+435 a A b^3-10 a^4 B+279 a^2 b^2 B+147 b^4 B\right ) \cos (c+d x)}{\sqrt {a+b \cos (c+d x)}} \, dx}{945 b}\\ &=\frac {2 \left (45 a^2 A b+75 A b^3-10 a^3 B+114 a b^2 B\right ) \sqrt {a+b \cos (c+d x)} \sin (c+d x)}{315 b d}+\frac {2 \left (45 a A b-10 a^2 B+49 b^2 B\right ) (a+b \cos (c+d x))^{3/2} \sin (c+d x)}{315 b d}+\frac {2 (9 A b-2 a B) (a+b \cos (c+d x))^{5/2} \sin (c+d x)}{63 b d}+\frac {2 B (a+b \cos (c+d x))^{7/2} \sin (c+d x)}{9 b d}-\frac {\left (\left (a^2-b^2\right ) \left (45 a^2 A b+75 A b^3-10 a^3 B+114 a b^2 B\right )\right ) \int \frac {1}{\sqrt {a+b \cos (c+d x)}} \, dx}{315 b^2}+\frac {\left (45 a^3 A b+435 a A b^3-10 a^4 B+279 a^2 b^2 B+147 b^4 B\right ) \int \sqrt {a+b \cos (c+d x)} \, dx}{315 b^2}\\ &=\frac {2 \left (45 a^2 A b+75 A b^3-10 a^3 B+114 a b^2 B\right ) \sqrt {a+b \cos (c+d x)} \sin (c+d x)}{315 b d}+\frac {2 \left (45 a A b-10 a^2 B+49 b^2 B\right ) (a+b \cos (c+d x))^{3/2} \sin (c+d x)}{315 b d}+\frac {2 (9 A b-2 a B) (a+b \cos (c+d x))^{5/2} \sin (c+d x)}{63 b d}+\frac {2 B (a+b \cos (c+d x))^{7/2} \sin (c+d x)}{9 b d}+\frac {\left (\left (45 a^3 A b+435 a A b^3-10 a^4 B+279 a^2 b^2 B+147 b^4 B\right ) \sqrt {a+b \cos (c+d x)}\right ) \int \sqrt {\frac {a}{a+b}+\frac {b \cos (c+d x)}{a+b}} \, dx}{315 b^2 \sqrt {\frac {a+b \cos (c+d x)}{a+b}}}-\frac {\left (\left (a^2-b^2\right ) \left (45 a^2 A b+75 A b^3-10 a^3 B+114 a b^2 B\right ) \sqrt {\frac {a+b \cos (c+d x)}{a+b}}\right ) \int \frac {1}{\sqrt {\frac {a}{a+b}+\frac {b \cos (c+d x)}{a+b}}} \, dx}{315 b^2 \sqrt {a+b \cos (c+d x)}}\\ &=\frac {2 \left (45 a^3 A b+435 a A b^3-10 a^4 B+279 a^2 b^2 B+147 b^4 B\right ) \sqrt {a+b \cos (c+d x)} E\left (\frac {1}{2} (c+d x)|\frac {2 b}{a+b}\right )}{315 b^2 d \sqrt {\frac {a+b \cos (c+d x)}{a+b}}}-\frac {2 \left (a^2-b^2\right ) \left (45 a^2 A b+75 A b^3-10 a^3 B+114 a b^2 B\right ) \sqrt {\frac {a+b \cos (c+d x)}{a+b}} F\left (\frac {1}{2} (c+d x)|\frac {2 b}{a+b}\right )}{315 b^2 d \sqrt {a+b \cos (c+d x)}}+\frac {2 \left (45 a^2 A b+75 A b^3-10 a^3 B+114 a b^2 B\right ) \sqrt {a+b \cos (c+d x)} \sin (c+d x)}{315 b d}+\frac {2 \left (45 a A b-10 a^2 B+49 b^2 B\right ) (a+b \cos (c+d x))^{3/2} \sin (c+d x)}{315 b d}+\frac {2 (9 A b-2 a B) (a+b \cos (c+d x))^{5/2} \sin (c+d x)}{63 b d}+\frac {2 B (a+b \cos (c+d x))^{7/2} \sin (c+d x)}{9 b d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 1.66, size = 291, normalized size = 0.78 \begin {gather*} \frac {8 \sqrt {\frac {a+b \cos (c+d x)}{a+b}} \left (b^2 \left (405 a^2 A b+75 A b^3+155 a^3 B+261 a b^2 B\right ) F\left (\frac {1}{2} (c+d x)|\frac {2 b}{a+b}\right )+\left (45 a^3 A b+435 a A b^3-10 a^4 B+279 a^2 b^2 B+147 b^4 B\right ) \left ((a+b) E\left (\frac {1}{2} (c+d x)|\frac {2 b}{a+b}\right )-a F\left (\frac {1}{2} (c+d x)|\frac {2 b}{a+b}\right )\right )\right )+b (a+b \cos (c+d x)) \left (2 \left (540 a^2 A b+345 A b^3+20 a^3 B+747 a b^2 B\right ) \sin (c+d x)+b \left (\left (540 a A b+300 a^2 B+266 b^2 B\right ) \sin (2 (c+d x))+5 b (2 (9 A b+19 a B) \sin (3 (c+d x))+7 b B \sin (4 (c+d x)))\right )\right )}{1260 b^2 d \sqrt {a+b \cos (c+d x)}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(1634\) vs.
\(2(402)=804\).
time = 0.46, size = 1635, normalized size = 4.40
method | result | size |
default | \(\text {Expression too large to display}\) | \(1635\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [C] Result contains higher order function than in optimal. Order 9 vs. order
4.
time = 0.18, size = 639, normalized size = 1.72 \begin {gather*} \frac {\sqrt {2} {\left (-20 i \, B a^{5} + 90 i \, A a^{4} b + 93 i \, B a^{3} b^{2} - 345 i \, A a^{2} b^{3} - 489 i \, B a b^{4} - 225 i \, A b^{5}\right )} \sqrt {b} {\rm weierstrassPInverse}\left (\frac {4 \, {\left (4 \, a^{2} - 3 \, b^{2}\right )}}{3 \, b^{2}}, -\frac {8 \, {\left (8 \, a^{3} - 9 \, a b^{2}\right )}}{27 \, b^{3}}, \frac {3 \, b \cos \left (d x + c\right ) + 3 i \, b \sin \left (d x + c\right ) + 2 \, a}{3 \, b}\right ) + \sqrt {2} {\left (20 i \, B a^{5} - 90 i \, A a^{4} b - 93 i \, B a^{3} b^{2} + 345 i \, A a^{2} b^{3} + 489 i \, B a b^{4} + 225 i \, A b^{5}\right )} \sqrt {b} {\rm weierstrassPInverse}\left (\frac {4 \, {\left (4 \, a^{2} - 3 \, b^{2}\right )}}{3 \, b^{2}}, -\frac {8 \, {\left (8 \, a^{3} - 9 \, a b^{2}\right )}}{27 \, b^{3}}, \frac {3 \, b \cos \left (d x + c\right ) - 3 i \, b \sin \left (d x + c\right ) + 2 \, a}{3 \, b}\right ) - 3 \, \sqrt {2} {\left (10 i \, B a^{4} b - 45 i \, A a^{3} b^{2} - 279 i \, B a^{2} b^{3} - 435 i \, A a b^{4} - 147 i \, B b^{5}\right )} \sqrt {b} {\rm weierstrassZeta}\left (\frac {4 \, {\left (4 \, a^{2} - 3 \, b^{2}\right )}}{3 \, b^{2}}, -\frac {8 \, {\left (8 \, a^{3} - 9 \, a b^{2}\right )}}{27 \, b^{3}}, {\rm weierstrassPInverse}\left (\frac {4 \, {\left (4 \, a^{2} - 3 \, b^{2}\right )}}{3 \, b^{2}}, -\frac {8 \, {\left (8 \, a^{3} - 9 \, a b^{2}\right )}}{27 \, b^{3}}, \frac {3 \, b \cos \left (d x + c\right ) + 3 i \, b \sin \left (d x + c\right ) + 2 \, a}{3 \, b}\right )\right ) - 3 \, \sqrt {2} {\left (-10 i \, B a^{4} b + 45 i \, A a^{3} b^{2} + 279 i \, B a^{2} b^{3} + 435 i \, A a b^{4} + 147 i \, B b^{5}\right )} \sqrt {b} {\rm weierstrassZeta}\left (\frac {4 \, {\left (4 \, a^{2} - 3 \, b^{2}\right )}}{3 \, b^{2}}, -\frac {8 \, {\left (8 \, a^{3} - 9 \, a b^{2}\right )}}{27 \, b^{3}}, {\rm weierstrassPInverse}\left (\frac {4 \, {\left (4 \, a^{2} - 3 \, b^{2}\right )}}{3 \, b^{2}}, -\frac {8 \, {\left (8 \, a^{3} - 9 \, a b^{2}\right )}}{27 \, b^{3}}, \frac {3 \, b \cos \left (d x + c\right ) - 3 i \, b \sin \left (d x + c\right ) + 2 \, a}{3 \, b}\right )\right ) + 6 \, {\left (35 \, B b^{5} \cos \left (d x + c\right )^{3} + 5 \, B a^{3} b^{2} + 135 \, A a^{2} b^{3} + 163 \, B a b^{4} + 75 \, A b^{5} + 5 \, {\left (19 \, B a b^{4} + 9 \, A b^{5}\right )} \cos \left (d x + c\right )^{2} + {\left (75 \, B a^{2} b^{3} + 135 \, A a b^{4} + 49 \, B b^{5}\right )} \cos \left (d x + c\right )\right )} \sqrt {b \cos \left (d x + c\right ) + a} \sin \left (d x + c\right )}{945 \, b^{3} d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: SystemError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \int \cos \left (c+d\,x\right )\,\left (A+B\,\cos \left (c+d\,x\right )\right )\,{\left (a+b\,\cos \left (c+d\,x\right )\right )}^{5/2} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________